package com.woniuxy.threeproject.end_water_project_user.controller;


import com.woniuxy.threeproject.end_water_project_user.commons.Result;
import com.woniuxy.threeproject.end_water_project_user.domain.Details;
import com.woniuxy.threeproject.end_water_project_user.service.impl.DetailsServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 文章详情表 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2021-08-25
 */
@RestController
@CrossOrigin("*")
@Slf4j
@RequestMapping("details")
public class DetailsController {

    @Autowired
    private DetailsServiceImpl detailsServiceImpl;

    @GetMapping("getDetails")
    public Result getDetails(int detailsId){
        log.info("detailsId:{}",detailsId);
        List<Details>  reDian = detailsServiceImpl.getDetails(detailsId);

        return new Result(true,"200","成功",reDian);
    }
}

